solving equations that are quadratic in form